﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BillShow.aspx.cs" Inherits="Admin_BillShow" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server" displaymode="List">
    <title>UPEX&nbsp;-&nbsp;网上制单</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="../css/main-admin.css" rel="stylesheet" type="text/css" />
    <style>
        .imgbtn
        {
            margin-left: 700px;
        }
    </style>

    <script src="../Jscript/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="../Jscript/jquery-ui-1.7.2.min.js" type="text/javascript"></script>

    <script src="../Jscript/jquery.ysbcheck.js" type="text/javascript"></script>

    <script src="../Jscript/jquery.myvalidate.js" type="text/javascript"></script>

    <script src="../Jscript/page.js" type="text/javascript"></script>

    <script src="../Jscript/jq_show_div.js" type="text/javascript"></script>

    <link href="../css/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .bordercss
        {
            border: 1px solid #CCC;
        }
        .jifeitypecss
        {
            width: 130px;
            border: 1px solid #CCC;
            height: 20px;
            margin-right: 10px;
        }
    </style>
	       <script type="text/javascript">
        function OpenWindow() {
            var id = window.document.getElementById("companynamepy").value;
			var id2 = window.document.getElementById("namepy").value;
			var id3 = window.document.getElementById("tozipcode").value;
			var id4 = window.document.getElementById("website").value;
			var id5 = window.document.getElementById("TrackingNo").value;
			var id6 = window.document.getElementById("chenshi").value;
			var id7 = window.document.getElementById("nameenglish1").value;
            var url = "/admin/test/updatepage.asp?name=" + id2 +"&tozipcode=" + id3 +"&website=" + id4 +"&TrackingNo=" + id5 +"&chenshi=" + id6 +"&nameenglish1=" + id7 +"&test=" + id;
            window.open(url, 'new' ,'height=1, width=1');
        }
    </script>
	
    <script type="text/javascript">
        var IsHaveFendan=<%=IsHaveFendan%>;
        var mg = <%=Mg %>;
        var notmg = <%=NotMg %>;
        var liuyan = ",";
        var ismg = <%=IsMg %>;
        var daigoufeilv=<%=DaigouFl %>;
        var nh=<%=seph%>
        var baozhuangfeilv=<%=BaozhuangFL %>;
        var liuyan = ",";
        $(document).ready(function() {




            //   var h = $("body").innerHeight() + 100;
            // var h = $(document).height() + 50;

            var h = 1500 + nh



            window.parent.document.getElementById("mainshow").style.height = h + "px";

            $("#uppricebtn").click(function() {
                AllPay();
            });

            $("#Okbtn").Ck();

            $("#UserGet").dialog({
                width: 800,
                height: 450,
                bgiframe: true,
                modal: true,
                autoOpen: false,
                position: ["200", "300"]
            })

            $("#NameSelect").dialog({
                width: 800,
                height: 450,
                bgiframe: true,
                modal: true,
                autoOpen: false,
                position: ["200", "100"]
            })
            $("#StateEdit").dialog({
                width: 600,
                height: 250,
                bgiframe: true,
                modal: true,
                autoOpen: false,
                position: ["200", "100"]
            })


            $("#ipgs").click(function() {//  查找客户

                $("#UserGet").dialog('open');
                //如果选择的是不是公司账户。。弹出


            });
            $("#accno_txt").YsbValid({ msg: "请输入5-20位字符", minlen: 5, maxlen: 20 });
            $("#sendertxt").YsbValid({ notnull: true });
            $("#renametxt").YsbValid({ notnull: true });
            $("#addtxt").YsbValid({ notnull: true });
            $("#readdtxt").YsbValid({ notnull: true });
            $("#zhongliang_txt").YsbValid({ notnull: true, type: "decimal" });
            //  $("#phonenotxt").YsbValid({ type: "tel", maxlen: 20,reg:"/^(\d{2,4}[-_－—]?)?\d{3,8}([-_－—]?\d{3,8})?([-_－—]?\d{1,7})?$)|(^0?1[35]\d{9}$/" });
            //  $("#rephonenotxt").YsbValid({ type: "tel", maxlen: 20,reg:"/^(\d{2,4}[-_－—]?)?\d{3,8}([-_－—]?\d{3,8})?([-_－—]?\d{1,7})?$)|(^0?1[35]\d{9}$/" });
          //  $("#phonenotxt").YsbValid({ type: "number", msg: "请输入5-20位数字", minlen: 5, maxlen: 20 });
          //  $("#rephonenotxt").YsbValid({ type: "number", msg: "请输入5-20位数字", minlen: 5, maxlen: 20 });
            $("#changtxt").YsbValid({ type: "decimal" });
            $("#kuantxt").YsbValid({ type: "decimal" });
            $("#gaotxt").YsbValid({ type: "decimal" });
            $("#dianfufeilb").YsbValid({ notnull: true, type: "decimal" });
            $("#guanshuitxt").YsbValid({ notnull: true, type: "decimal" });
            $("#baoxianfeitxt").YsbValid({ notnull: true, type: "decimal" });
            $("#youhuitxt").YsbValid({ notnull: true, type: "decimal" });
            $("#othertxt").YsbValid({ notnull: true, type: "decimal" });
            $("#num1").YsbValid({ type: "number" });
            $("#num2").YsbValid({ type: "number" });
            $("#price1").YsbValid({ type: "decimal" });
            $("#price2").YsbValid({ type: "decimal" });

            $("#zhongliang_txt").change(function() {
                //重量比较
                ToShowSF();
            });
            $("#changtxt").change(function() {
                //长
                ToShowSF();
            });
            $("#kuantxt").change(function() {
                //宽
                ToShowSF();
            });
            $("#gaotxt").change(function() {
                //高
                ToShowSF();
            });

            //海关总价
            $("#price1").change(function() {
                //1价格
                ToShowHg();
            });
            $("#price2").change(function() {
                //2价格
                ToShowHg();
            });

            $("#dianfufeilb").change(function() {
                //垫付费变化
                //代购费=垫付费用*5%
                var daigou = changeTwoDecimal_f($(this).val() * daigoufeilv * parseFloat2(0.01));

                $("#daigoufeihd").val(daigou);
                $("#daigoufeilb").html(daigou);
                ToShowAll();
            });

            $("#guanshuitxt").change(function() {
                //关税
                ToShowAll();

            });

            $("#baoxianfeitxt").change(function() {
                //保险费
                ToShowAll();

            });

            $("#othertxt").change(function() {
                //其他费用

                ToShowAll();
            });

            $("#youhuitxt").change(function() {
                //优惠
                ToShowAll();

            });


            $("#addliuyan").click(function() {//留言


                var value = $("#liuyandiv").html();
                liuyan = liuyan + $("#liuyanneirong").val() + ","
                $("#liuyanhd").val(liuyan);
                value += "  <div style=\"margin-top: 5px; float: left; width: 966px;\">";


                value += " <font color=\"#0099FF\">公司：</font> " + $("#liuyanneirong").val() + "</div>";

                $("#liuyandiv").html(value);
            });
            $("#jifeitype").change(function() {

                toWeightPay();


            });



        });


        function ToSetBaozhuang() {


            var fy = parseFloat2($("#ChargedWt").html()) * parseFloat2(baozhuangfeilv);


            $("#baozhuangfeihd").val(changeTwoDecimal_f(fy));
            $("#baozhuangfeilb").html(changeTwoDecimal_f(fy));
        }

        //海关总价
        function ToShowHg() {

            var hg = changeTwoDecimal_f(parseFloat2($("#price1").val()) + parseFloat2($("#price2").val()));
            $("#haiguanhd").val(hg);
            $("#haiguanall").html(hg);
        }
        //收费重量
        function ToShowSF() {

            var zhongliang = $("#zhongliang_txt").val();
            var fy = parseFloat2($("#changtxt").val()) * parseFloat2($("#kuantxt").val()) * parseFloat2($("#gaotxt").val())


            var tijizhongliang = 0;

            if (isNaN(fy)) {

            }
            else {

                if (ismg == true) {
                    tijizhongliang = fy / mg;
                }
                else {
                    tijizhongliang = fy / notmg;
                }

            }



            $("#tijizhonglianghd").val(tijizhongliang);

            if (zhongliang > tijizhongliang) {


                $("#shoufeizhonglianghd").val(changeTwoDecimal_f(zhongliang));
                $("#ChargedWt").html(changeTwoDecimal_f(zhongliang));

            }
            else {
                $("#shoufeizhonglianghd").val(changeTwoDecimal_f(tijizhongliang));
                $("#ChargedWt").html(changeTwoDecimal_f(tijizhongliang));
            }





            toWeightPay();


            ToSetBaozhuang(); //包装费率影响
            ToShowAll(); //影响到所有费用

        }
        function toWeightPay() {//收费重量


            var weight = $("#ChargedWt").html();


            if (weight > 0) {
                var value = $("#jifeitype option:selected").val();

                if (value == "") {
                    OpenWindow('计费类别异常');
                    return;
                }
                var sb = "";
                var f = value.indexOf(",");
                var e = value.lastIndexOf(",")


                var sb = value.substring(f + 1, e);
                var cb = value.substring(e + 1);




                if (weight > 4) {
                var cbw = weight * cb;
                 $("#FreightChargelb").html(changeTwoDecimal_f(cbw));
                }
                else
                {
                var cbw = (weight - 1) * cb;
                 $("#FreightChargelb").html(changeTwoDecimal_f(parseFloat2(sb) + cbw));
                }

                $("#zlshoufeihd").val($("#FreightChargelb").html());
                $("#paytypehd").val(value.substring(0, f));
                ToShowAll();

            }
        }


        //设置所有费用
        function ToShowAll() {


            var zongfei = parseFloat2($("#FreightChargelb").html()) + parseFloat2($("#dianfufeilb").val()) + parseFloat2($("#daigoufeilb").html()) + parseFloat2($("#baozhuangfeilb").html()) + parseFloat2($("#guanshuitxt").val()) + parseFloat2($("#baoxianfeitxt").val()) + parseFloat2($("#othertxt").val()) - parseFloat2($("#youhuitxt").val());
            $("#Totalhb").val(changeTwoDecimal_f(zongfei));
            $("#Totallb").html(changeTwoDecimal_f(zongfei));
        }


         function addState(tno) {
        //alert(tno);
            if(document.getElementById("statedate").value=="")
            {
                alert("请输入日期！");
                return false;
            }

            var statename = $("#statelistdrr option:selected").text();
            var stateid = $("#statelistdrr option:selected").val();
            var date = $("#statedate").val();
            //alert(date);
            var gongsi = $("#cplistdrr").val();
            var zhuanyundanha = $("#zhuanyuntxt").val();
            var beizhu = $("#beizhutxt").val();
            var jijianren =$("#Email").val();
//            var jijianren = document.getElementById("lbgsr").valu
      //     alert(jijianren);
            OpenWindow('状态录入中..');

          $.get("UpdateState.ashx", { Sname: statename, Tno: tno, state: stateid, ndate: date, gs: gongsi, zy: zhuanyundanha, bz: beizhu, jjr:jijianren }, function(data) {
       //     alert("11111111111111111111");
                if (data == "ok") {
                    OpenWindow('状态录入成功..');
                    location.reload();
                }
                else {
                    OpenWindow('状态录入失败..');
                }
            })
        }



        function parseFloat2(value) {
            var f_x = parseFloat(value);
            if (isNaN(f_x)) {
                return 0;
            }
            else {
                return f_x;
            }
        }

        function changeTwoDecimal_f(x) {
            var f_x = parseFloat(x);
            if (isNaN(f_x)) {
                //   OpenWindow('您输入数字有误，请输入数字' + x);
                return false;
            }
            var f_x = Math.round(x * 100) / 100;
            var s_x = f_x.toString();
            var pos_decimal = s_x.indexOf('.');
            if (pos_decimal < 0) {

                pos_decimal = s_x.length;
                s_x += '.';
            }
            while (s_x.length <= pos_decimal + 2) {
                s_x += '0';
            }
            return s_x;
        }

        function ToSetSender(id, ann, name, tel, com, add) {


            $("#gs_txt").val(ann);

            $("#creaduser").val(id);



            $("#sendertxt").val(name);
            $("#phonenotxt").val(tel);
            $("#addtxt").val(add);
            $("#companytxt").val(com);
        }
        function Todel() {

            if (confirm("是否删除单据？") == true) {
                return true;
            }
            else {
                return false;
            }
        }
        function EditValue(tp) {

            var tnvalue = '';
            $("input[type=checkbox]").each(function() {

                if ($(this).attr("checked") == true) {

                    tnvalue = tnvalue + "," + $(this).val();
                }
            });
            if (tnvalue == "") {
                OpenWindow("你并未选择到有单据");
            }
            else {

                switch (tp) {
                    case "name":
                        window.location = "NameEdte.aspx?no=" + tnvalue;
                        break;
                    case "logo":
                        window.location = "BillLogoPl.aspx?no=" + tnvalue;
                        break;
                    case "other":
                        window.location = "OtherEdit.aspx?no=" + tnvalue;
                        break;
                    case "price":
                        window.location = "PriceEdit.aspx?no=" + tnvalue;
                        break;

                    case "print":
                        window.location = "ToPdf.aspx?no=" + tnvalue;
                        break;

                    case "del":

                        if (confirm("是否删除当前选择分单？") == true) {
                            OpenWindow("单据删除中.....请勿关闭！");
                            $.post("DelBill.ashx", { Tno: tnvalue }, function(data) {

                                if (data == "ok") {

                                    OpenWindow("单据删除成功!页面将刷新");
                                    location.reload();
                                }
                                else {

                                    OpenWindow(data);
                                }

                            });
                        }
                        break;
                }
            }

        }
        function ToSetSender(id, ann, name, tel, com, add, cp, bz, dg) {
            $("#UserGet").dialog('close');

            $("#ipgs").val(name);
            $("#ipgs").attr("title", id);

        }
        function ToSetGS() {
            var v = $("#ipgs").attr("title");
            var no = $("#tnlb").html();

            if ($.trim(v) == "") {
                alert("请重新选择归属人");
                return;
            }

            $.get("ToSetGs.ashx", { id: v, Tno: no }, function(data) {

                if (data == "ok") {
                    alert('归属人更新成功！请重新设置当前单价等..');
                    location.reload();
                }
                else {
                    alert('归属人更新失败..');
                }
            })



        }



        var ntype = "";

        function ShowNameSelect(type) {
            ntype = type;

            $("input[type=checkbox]").each(function() {

                if ($(this).attr("checked") == true) {


                    if ($(this).attr("name") == "toselectnameck") {
                        $(this).attr("checked", false);
                    }
                }
            });

            $("#NameSelect").dialog('open');
        }


        function ToNameSelect() {

            var select = ""
            $("input[type=checkbox]").each(function() {

                if ($(this).attr("checked") == true) {

                    if ($(this).attr("name") == "toselectnameck") {

                        select += "," + $(this).val();
                    }
                }
            });





            var nv = $("#name" + ntype).val();
            $("#name" + ntype).val(nv + select);

            $("#NameSelect").dialog('close');
        }

        function ToDelState(id, state) {

      
            if (state == "1") {
                alert("当前状态 不允许删除");
                return;
            }
            $.get("../Jscript/ToDelState.ashx", { nid: id }, function(data) {

                if (data == "0") {

                    alert("删除失败");
                }
                else {
                    alert(data);
                    location.reload();
                }
            })


        }


        function ToShowEdit(id) {
  
            $("#EditShowImage").attr("title", id);
            $("#dateedit").val($.trim($("#state" + id + " div:nth-child(2)").html())); //日期
            var zt = $.trim($("#state" + id + " div:nth-child(3)").html()); //状态
            $("#stateedit").val(zt);
            var zyg = $.trim($("#state" + id + " div:nth-child(4)").html()); //转运公司
            $("#gongsiedit").val(zyg);
            $("#danhaoedit").val($.trim($("#state" + id + " div:nth-child(5)").html())); //日期
            $("#beizhuedit").val($.trim($("#state" + id + " div:nth-child(6)").html())); //日期  
            $("#StateEdit").dialog('open');


        }
        function ToPostSatate() {
        
       
            var id = $("#EditShowImage").attr("title");
            if (id == "") {
                alert("界面参数异常！请刷新界面重试！");
                return;
            }
            var statename = $("#stateedit option:selected").text();
            var stateid = $("#stateedit option:selected").val();
            var date = $("#dateedit").val();
            var gongsi = $("#gongsiedit").val();
            var zhuanyundanha = $("#danhaoedit").val();
            var beizhu = $("#beizhuedit").val();
 

            OpenWindow('状态编辑中..');
            $.get("ToUpdateState.ashx", { Sname: statename, Sid: id, state: stateid, ndate: date, gs: gongsi, zy: zhuanyundanha, bz: beizhu }, function(data) {

                if (data == "ok") {
                    OpenWindow('状态编辑成功..请关闭');
                    
 
                    location.reload();
                }
                else {
                    OpenWindow('状态编辑失败..');
                }
            })
        }
    </script>

    <script src="../Jscript/BillPayAll.js" type="text/javascript"></script>

</head>
<body style='height: 1400px'>

    <script type="text/javascript" src="../DatePicker/WdatePicker.js"></script>

    <form id="for1m1" runat="server">
    <div class="title floatleft">
        运单 &nbsp;<asp:Label ID="tnlb" runat="server"></asp:Label></div>
    <div class="title-btn floatleft">
        <a href='ToPdf.aspx?no=<%=Request.QueryString["Tno"].ToString()%>&sep=false'>
            <img alt="" src="../images/btn-title-printtrans.gif" width="68" height="25" /></a>
        &nbsp;
        <img src="../images/btn-title-print.gif" width="68" onclick="javascript:window.print();"
            height="25" />
        &nbsp;
        <asp:ImageButton ID="delbtn" runat="server" OnClientClick="return Todel()" ImageUrl="~/images/btn-title-del.gif"
            Width="68" Height="25" OnClick="delbtn_Click" />
        &nbsp; <a href='BillEdit.aspx?area=cy&tno=<%=Request.QueryString["Tno"].ToString()%>'>
            <img src="../images/btn-title-reuse.gif" width="68" height="25" /></a>
    </div>
    <div>
        当前归属人：<asp:Label ID="lbgsr" runat="server"></asp:Label>
        &nbsp; &nbsp;归属调整： &nbsp;
        <input id="ipgs" type="text" readonly="readonly" />
        <input type="button" value="确认调整" onclick="ToSetGS()" style="width: 70px">
    </div>
    <div style="width: 483px; color: #606; font-weight: bold; float: left">
        寄件人资料
    </div>
    <div style="width: 483px; color: #606; font-weight: bold; float: left">
        收件人资料：
    </div>
    <div style="width: 483px; margin-top: 10px; float: left">
        姓名
        <input type="text" name="textfield" id="sendertxt" runat="server" style="width: 163px;
            border: 1px solid #CCC; margin-right: 10px; height: 15px;" />
        电话
        <input type="text" name="textfield" id="phonenotxt" runat="server" style="width: 181px;
            border: 1px solid #CCC; height: 15px; margin-right: 20px;" />
        <div style="height: 8px;">
            &nbsp;</div>
        公司名称
        <input type="text" name="textfield" id="companytxt" runat="server" style="width: 380px;
            border: 1px solid #CCC; height: 15px; margin-right: 20px;" />
        <div style="height: 8px;">
            &nbsp;</div>
        邮寄地址
        <input type="text" name="textfield" id="addtxt" runat="server" style="width: 380px;
            border: 1px solid #CCC; height: 15px; margin-right: 20px;" />
    </div>
    <div style="width: 483px; margin-top: 10px; float: left">
        姓名
        <input type="text" name="textfield" id="renametxt" runat="server" style="width: 163px;
            border: 1px solid #CCC; margin-right: 10px; height: 15px;" />
        电话
        <input type="text" name="textfield" id="rephonenotxt" runat="server" style="width: 181px;
            border: 1px solid #CCC; height: 15px; margin-right: 20px;" />
        <div style="height: 8px;">
            &nbsp;</div>
        公司名称
        <input type="text" name="textfield" id="recompanytxt" runat="server" style="width: 380px;
            border: 1px solid #CCC; height: 15px; margin-right: 20px;" />
        <div style="height: 8px;">
            &nbsp;</div>
        邮寄地址
        <input type="text" name="textfield" id="readdtxt" runat="server" style="width: 380px;
            border: 1px solid #CCC; height: 15px; margin-right: 20px;" />
    </div>
    <div style="color: #606; font-weight: bold; float: left; width: 966px; margin-top: 20px;">
        参考号/订单号
        <input type="text" name="textfield" id="FlightNotxt" runat="server" style="width: 110px;
            border: 1px solid #CCC; margin-right: 30px; height: 15px;" />
        启运地
        <asp:DropDownList ID="qyd_ddr" runat="server" Width="90px" Height="20px" CssClass="bordercss">
        </asp:DropDownList>
        口岸
        <asp:DropDownList ID="mdd_ddr" runat="server" Width="90px" Height="20px" CssClass="bordercss">
        </asp:DropDownList>
        航空单号
        <input type="text" name="textfield" id="AerialNotxt" runat="server" style="width: 100px;
            border: 1px solid #CCC; height: 15px;" />
         地址拼音 
        <input type="text" name="textfield" id="companynamepy" runat="server" style="width: 100px;
            border: 1px solid #CCC; height: 15px;" />
      名称拼音
      <input type="text" name="textfield" id="namepy" runat="server" style="width: 100px;
            border: 1px solid #CCC; height: 15px;" />
	   zipcode
	   <input type="text" name="textfield" id="tozipcode" runat="server" style="width: 100px;
            border: 1px solid #CCC; height: 15px;" />
	   webiste
	   <input type="text" name="textfield" id="website" runat="server" style="width: 100px;
            border: 1px solid #CCC; height: 15px;" />
	   收件人城市
	   <input type="text" name="textfield" id="chenshi" runat="server" style="width: 100px;
            border: 1px solid #CCC; height: 15px;" />
	   <input type="hidden" name="textfield" id="Email" runat="server" style="width: 100px;
            border: 1px solid #CCC; height: 15px;" />
	   <input type="hidden" name="textfield" id="TrackingNo" runat="server" style="width: 100px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="color: #606; font-weight: bold; float: left; width: 966px; margin-top: 20px;">
        运送货物资料：</div>
    <div style="margin-top: 10px; float: left; width: 966px;">
        货物种类：
        <asp:RadioButtonList ID="huowulist" runat="server" h RepeatDirection="Horizontal">
            <asp:ListItem Text="文件" Value="0" Selected="True"></asp:ListItem>
            <asp:ListItem Text="私人包裹" Value="1"></asp:ListItem>
            <asp:ListItem Text="商业样品" Value="2"></asp:ListItem>
        </asp:RadioButtonList>
    </div>
    <div style="margin-top: 10px; float: left; width: 966px;">
        <div style="margin-right: 555px; float: left;">
            货物品名</div>
        <div style="margin-right: 150px; float: left;">
            货物英文</div>
        <div style="margin-right: 35px; float: left;">
            数量</div>
        <div style="float: left;">
            海关申报价</div>
    </div>
    <div style="margin-top: 8px; float: left; width: 966px;">
        <img src="../Images/insertname.jpg" border="0" align="absmiddle" onclick="ShowNameSelect('1')" />
        <input type="text" name="textfield2" id="name1" runat="server" style="width: 500px;
            border: 1px solid #CCC; height: 15px; margin-right: 15px;" />
        <input type="text" name="textfield2" id="nameenglish1" runat="server" style="width: 200px;
            border: 1px solid #CCC; height: 15px;" />
        <input type="text" name="textfield2" id="num1" runat="server" style="width: 40px;
            border: 1px solid #CCC; height: 15px; margin-right: 15px;" />
        <input type="text" name="textfield2" id="price1" runat="server" style="width: 70px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="margin-top: 8px; float: left; width: 966px;">
        <img src="../Images/insertname.jpg" border="0" align="absmiddle" onclick="ShowNameSelect('2')" />
        <input type="text" name="textfield2" id="name2" runat="server" style="width: 500px;
            border: 1px solid #CCC; height: 15px; margin-right: 15px;" />
        <input type="text" name="textfield2" id="nameenglish2" runat="server" style="width: 200px;
            border: 1px solid #CCC; height: 15px;" />
        <input type="text" name="textfield2" id="num2" runat="server" style="width: 40px;
            border: 1px solid #CCC; height: 15px; margin-right: 15px;" />
        <input type="text" name="textfield2" id="price2" runat="server" style="width: 70px;
            border: 1px solid #CCC; height: 15px;" />
    </div>
    <div style="margin-top: 10px; float: left; text-align: right; width: 916px; color: #09F;">
        海关申报总价： $<asp:Label ID="haiguanall" runat="server" Text="0"></asp:Label></div>
    <div style="color: #606; font-weight: bold; float: left; width: 966px; margin-top: 5px;">
        货物重量资料：</div>
    <div style="margin-top: 10px; float: left; width: 966px;">
        重量：<input type="text" name="textfield2" id="zhongliang_txt" runat="server" style="width: 40px;
            border: 1px solid #CCC; height: 15px;" />
        磅<span style="margin-right: 30px;">&nbsp;</span> 包裹尺寸：长
        <input type="text" name="textfield2" id="changtxt" runat="server" style="width: 40px;
            border: 1px solid #CCC; height: 15px;" />
        英寸 &nbsp; X &nbsp; 宽
        <input type="text" name="textfield2" id="kuantxt" runat="server" style="width: 40px;
            border: 1px solid #CCC; height: 15px;" />
        英寸 &nbsp; X &nbsp; 高
        <input type="text" name="textfield2" id="gaotxt" runat="server" style="width: 40px;
            border: 1px solid #CCC; height: 15px;" />
        英寸</div>
    <div style="color: #606; font-weight: bold; float: left; width: 80px; margin-top: 22px;">
        支付方式：</div>
    <div style="margin-top: 18px; float: left; width: 886px; height: 20px;">
        <asp:RadioButtonList ID="paylist" runat="server" h RepeatDirection="Horizontal">
            <asp:ListItem Text="现金" Value="1" Selected="True"></asp:ListItem>
            <asp:ListItem Text="月结" Value="2"></asp:ListItem>
            <asp:ListItem Text="到付" Value="3"></asp:ListItem>
        </asp:RadioButtonList>
    </div>
    <div style="color: #606; font-weight: bold; float: left; width: 55px; margin-top: 18px;">
        总收费：</div>
    <div style="margin-top: 18px; float: left; width: 911px;">
        $<asp:Label ID="Totallb" runat="server" Text="0.00"></asp:Label>
    </div>
    <div style="margin-top: 10px; float: left; width: 966px; height: 20px; border-bottom: 1px solid #CCC;">
        <div style="margin-right: 20px; float: left;">
            收费重量</div>
        <div style="margin-right: 83px; float: left;">
            计费类别</div>
        <div style="margin-right: 35px; float: left;">
            重量收费</div>
        <div style="margin-right: 55px; float: left;">
            垫付费用</div>
        <div style="margin-right: 35px; float: left;">
            代购费</div>
        <div style="margin-right: 35px; float: left;">
            包装费</div>
        <div style="margin-right: 45px; float: left;">
            关税</div>
        <div style="margin-right: 40px; float: left;">
            保险费</div>
        <div style="margin-right: 45px; float: left;">
            其他费</div>
        <div style="margin-right: 35px; float: left;">
            优惠</div>
    </div>
    <div style="margin-top: 5px; float: left; width: 966px; height: 20px;">
        <div style="margin-left: 5px; float: left; width: 63px; margin-top: 3px;">
            <asp:Label ID="ChargedWt" runat="server" Text="0"></asp:Label>磅
        </div>
        <div style="width: 130px; float: left;">
            <asp:DropDownList ID="jifeitype" runat="server" CssClass="jifeitypecss">
            </asp:DropDownList>
        </div>
        <div style="width: 83px; float: left; margin-top: 3px;">
            $
            <asp:Label ID="FreightChargelb" runat="server"></asp:Label>
        </div>
        <div style="width: 104px; float: left;">
            $
            <input type="text" name="textfield2" id="dianfufeilb" runat="server" style="width: 50px;
                border: 1px solid #CCC; height: 15px; margin-right: 15px;" /></div>
        <div style="width: 71px; float: left; margin-top: 3px;">
            $
            <asp:Label ID="daigoufeilb" runat="server"></asp:Label>
        </div>
        <div style="width: 71px; float: left; margin-top: 3px;">
            $
            <asp:Label ID="baozhuangfeilb" runat="server"></asp:Label></div>
        <div style="width: 70px; float: left;">
            $
            <input type="text" name="textfield2" id="guanshuitxt" runat="server" style="width: 40px;
                border: 1px solid #CCC; height: 15px;" /></div>
        <div style="width: 76px; float: left;">
            $
            <input type="text" name="textfield2" id="baoxianfeitxt" runat="server" style="width: 40px;
                border: 1px solid #CCC; height: 15px;" /></div>
        <div style="width: 81px; float: left;">
            $
            <input type="text" name="textfield2" id="othertxt" runat="server" style="width: 40px;
                border: 1px solid #CCC; height: 15px;" /></div>
        <div style="width: 70px; float: left; color: #F00;">
            -$
            <input type="text" name="textfield2" id="youhuitxt" runat="server" style="width: 40px;
                border: 1px solid #CCC; height: 15px; color: #F00;" /></div>
        <img src="../Images/btn-update-price.gif" width="54" height="20" align="absmiddle"
            id="uppricebtn" /></div>
    <div style="margin-top: 5px; float: left; width: 966px; height: 20px;">
        <span id="editshow"></span>
    </div>
    <div style="color: #606; font-weight: bold; float: left; width: 966px; margin-top: 20px;">
        分单信息：</div>
    <div class="trans-search-title floatleft" style="width: 966px; margin-top: 10px;">
        <div class="trans-search-selall">
            全选</div>
        <div class="trans-search-arr">
            &nbsp;</div>
        <div class="trans-search-no">
            货运单号</div>
        <div class="trans-search-status">
            货运状态</div>
        <div class="trans-search-sender">
            寄件人</div>
        <div class="trans-search-rec">
            收件人</div>
        <div class="trans-search-case">
            件数</div>
        <div class="trans-search-wt">
            磅</div>
        <div class="trans-search-ref">
            参考号</div>
        <div class="trans-search-price">
            价格</div>
        <div class="trans-search-date">
            制单时间</div>
    </div>
    <asp:Repeater ID="sepshow" runat="server">
        <ItemTemplate>
            <div class="trans-search-line floatleft" style="width: 966px;">
                <div class="trans-search-selall">
                    <input type="checkbox" name="checkbox" id='sep<%#Eval("TrackingNo").ToString()%>'
                        value='SepNo<%#Eval("SepNo")%>Tno<%#Eval("TrackingNo").ToString()%>' />
                </div>
                <div class="trans-search-arr mtop3">
                </div>
                <div class="trans-search-no mtop3">
                    <a href="#">
                        <%#Eval("SepNo")%></a></div>
                <div class="trans-search-status mtop3">
                    <%#Eval("SBState")%></div>
                <div class="trans-search-sender mtop3">
                    <%#Eval("SendBy")%></div>
                <div class="trans-search-rec mtop3">
                    <%#Eval("CHNReceiver")%></div>
                <div class="trans-search-case mtop3">
                    <%#Eval("Pieces")%></div>
                <div class="trans-search-wt mtop3">
                    <%#Eval("ChargedWt")%></div>
                <div class="trans-search-ref mtop3">
                    <%#Eval("FlightNo")%></div>
                <div class="trans-search-price mtop3">
                    $<%#Eval("Total")%></div>
                <div class="trans-search-date mtop3">
                    <%#Convert.ToDateTime( Eval("CreateDate").ToString()).ToShortDateString()%></div>
                <div class="trans-search-track mtop3">
                    <a href='zhuizong.aspx?id=<%#Eval("TrackingNo") %>'>跟踪</a></div>
                <div class="trans-search-seplogo mtop3">
                    <img src='../UpLoad/small/small<%#Eval("Logo") %>' width="53" height="13" />
                </div>
            </div>
        </ItemTemplate>
    </asp:Repeater>
    <div style="margin: 10px 0px 0px 3px; float: left; width: 966px;">
        <img src="../images/arrow-up.gif" width="25" height="24" />
        &nbsp;
        <img src="../images/btn-deletelot.gif" width="68" height="25" onclick="EditValue('del')" />
        &nbsp;
        <img src="../images/btn-itemlot.gif" width="68" height="25" onclick="EditValue('name')" />
        &nbsp;
        <img src="../images/btn-pringlogolot.gif" width="68" height="25" onclick="EditValue('logo')" />
    </div>
    <div style="color: #606; font-weight: bold; float: left; width: 966px; margin-top: 20px;">
        货运状态跟踪：</div>
    <div class="trans-search-title floatleft" style="width: 966px; margin-top: 10px;">
        <div class="trans-search-no">
            &nbsp;</div>
        <div class="trans-search-no">
            更新日期</div>
        <div style="width: 250px; float: left;">
            货运状态</div>
        <div class="trans-search-sender">
            转运公司</div>
        <div class="trans-search-date" style="width: 130px">
            转运单号</div>
        <div class="trans-search-date" style="width: 300px">
            备注</div>
    </div>
    <asp:Repeater ID="Sataterp" runat="server">
        <ItemTemplate>
            <div class="trans-search-line floatleft" style="width: 966px;" id="state<%#Eval("BSRID")%>">
                <div class="trans-search-no">
                    <img src="../images/icon-del.png" onclick="ToDelState('<%#Eval("BSRID")%>','<%#Eval("StateID")%>')" />
                    &nbsp; <a onclick="ToShowEdit('<%#Eval("BSRID")%>')">编辑</a>
                </div>
                <div class="trans-search-no">
                    <%# Convert.ToDateTime(Eval("Date").ToString()).ToShortDateString()%>
                </div>
                <div style="width: 250px; float: left;">
                    <%# new BLL.PublicSqlService().GetWords("Tbl_BillState", "Description", "BSID=" + Eval("StateID").ToString())%>
                </div>
                <div class="trans-search-sender">
                    <%# new BLL.PublicSqlService().GetWords("TblDomesticShipping", "CompanyName", "ID=" + Eval("CompanyID").ToString())%>
                </div>
                <div class="trans-search-date" style="width: 130px">
                    <%#Eval("CompanyNo")%></div>
                <div class="trans-search-date" style="width: 300px">
                    <%#Eval("remark")%></div>
            </div>
        </ItemTemplate>
    </asp:Repeater>
    <div id="statehtml">
    </div>
    <div style="margin-top: 0px; float: left; width: 966px;">
        添加新货状态跟踪：
        <asp:DropDownList ID="statelistdrr" runat="server" CssClass="jifeitypecss">
        </asp:DropDownList>
        日期：<input type="text" name="textfield" id="statedate" onfocus="WdatePicker({skin:'blue'})"
            style="width: 65px; border: 1px solid #CCC; height: 15px; margin-right: 20px;" />
        转运公司：
        <asp:DropDownList ID="cplistdrr" runat="server" CssClass="jifeitypecss">
        </asp:DropDownList>
        转运单号：<input type="text" name="textfield" id="zhuanyuntxt" style="width: 65px; border: 1px solid #CCC;
            height: 15px; margin-right: 20px;" />
        备注：<input type="text" name="textfield" id="beizhutxt" style="width: 145px; border: 1px solid #CCC;
            height: 15px; margin-right: 20px;" />
        <img src="../Images/btn-add-status.gif" width="68" height="25" align="absmiddle"
            onclick="addState('<%= Request.QueryString["Tno"].ToString()  %>')" /></div>
    <div style="color: #606; font-weight: bold; float: left; width: 966px; margin-top: 20px;">
        历史留言：</div>
    <asp:Repeater ID="lyshow" runat="server">
        <ItemTemplate>
            <div style="margin-top: 10px; float: left; width: 966px;">
                <font color="#FF9900">
                    <%#Eval("PostUser") %>：</font>
                <%#Eval("Content") %>
                &nbsp;
                <%#Eval("Attachment").ToString().Trim() == "" ? "无" : "<a target='_blank' href='../temp/" + Eval("Attachment") + "'> <img src=\"../images/icon-att-transp.png\" width=\"29\" height=\"15\" /></a>"%></div>
        </ItemTemplate>
    </asp:Repeater>
    <div style="color: #606; font-weight: bold; float: left; width: 966px; margin-top: 20px;">
        增加留言：</div>
    <div style="margin-top: 10px; float: left; width: 966px;">
        <textarea name="" id="liuyanneirong" runat="server" style="width: 950px; height: 80px;"></textarea></div>
    <div style="margin-top: 10px; float: left; width: 966px;">
        <img src="../Images/icon-attachment.gif" width="39" height="19" align="absmiddle" /><asp:FileUpload
            ID="imgfier" runat="server" />
        <asp:ImageButton ID="insertly" runat="server" ImageUrl="~/Images/btn-post-messg.gif"
            Width="121" Height="27" ImageAlign="AbsMiddle" CssClass="imgbtn" OnClick="insertly_Click" />
    </div>
    <div style="color: #606; font-weight: bold; float: left; width: 966px; margin-top: 20px;
        text-align: center;">
        <asp:ImageButton ID="Okbtn" runat="server" ImageUrl="~/Images/btn-save-trans.gif"
            Width="192" Height="40" OnClick="Okbtn_Click" />
    </div>
    <asp:HiddenField ID="stateidhd" runat="server" />
    <asp:HiddenField ID="statenamehd" runat="server" />
    <asp:HiddenField ID="datehd" runat="server" />
    <asp:HiddenField ID="gongsihd" runat="server" />
    <asp:HiddenField ID="danhaohd" runat="server" />
    <asp:HiddenField ID="liuyanhd" runat="server" />
    <asp:HiddenField ID="creaduser" runat="server" />
    <asp:HiddenField ID="tijizhonglianghd" runat="server" />
    <asp:HiddenField ID="Totalhb" runat="server" />
    <asp:HiddenField ID="haiguanhd" runat="server" />
    <asp:HiddenField ID="shoufeizhonglianghd" runat="server" />
    <asp:HiddenField ID="zlshoufeihd" runat="server" />
    <asp:HiddenField ID="daigoufeihd" runat="server" />
    <asp:HiddenField ID="baozhuangfeihd" runat="server" />
    <asp:HiddenField ID="paytypehd" runat="server" />
    <div id="UserGet" title="用户选择 - 请直接勾选后关闭">
        <iframe id="UserShow" src="UserGetShow.aspx" scrolling="no" width="750" height="380"
            style="z-index: 999;" frameborder="0"></iframe>
    </div>
    <div id="NameSelect" title="品名选择">
        <div style="width: 100%; text-align: center">
            <img src="../Images/okinsert.jpg" border="0" align="absmiddle" onclick="ToNameSelect() onclick="OpenWindow()" />
            <br />
            <br />
        </div>
        <asp:Repeater ID="Rpt_Name" runat="server">
            <ItemTemplate>
                <input type="checkbox" id="nameck" name="toselectnameck" value='<%#Eval("GoodsName")%>' />
                <%#Eval("GoodsName")%>
                <%#(((Container.ItemIndex + 1) % 9) == 0) ? "<br/><br/>" : ""%>
            </ItemTemplate>
        </asp:Repeater>
    </div>
    <div id="StateEdit" title="状态编辑">
        <div style="margin-top: 0px;">
            货运状态编辑：
            <asp:DropDownList ID="stateedit" runat="server" CssClass="jifeitypecss" Height="20px"
                Width="149px">
            </asp:DropDownList>
            &nbsp;&nbsp; 日期：<input type="text" id="dateedit" onfocus="WdatePicker({skin:'blue'})"
                style="width: 172px; border: 1px solid #CCC; height: 15px; margin-right: 20px;" />&nbsp;&nbsp;<br />
            <br />
            转运公司：
            <asp:DropDownList ID="gongsiedit" runat="server" CssClass="jifeitypecss" Width="158px">
            </asp:DropDownList>
            &nbsp; 转运单号：<input type="text" name="danhaoedit" id="danhaoedit" style="width: 125px;
                border: 1px solid #CCC; height: 15px; margin-right: 20px;" />
            <br />
            <br />
            备注：<input type="text" name="beizhuedit" id="beizhuedit" style="width: 434px; border: 1px solid #CCC;
                height: 15px; margin-right: 20px;" />
            <br />
            <br />
            &nbsp;&nbsp;&nbsp;
            <img src="../images/btn-save.gif" width="68" height="25" id="EditShowImage" align="absmiddle"
                onclick="ToPostSatate()" /></div>
    </div>
    </form>
</body>
</html>
